 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List; 

import org.springframework.beans.factory.annotation.Autowired; 

import com.viettel.core.exceptions.BusinessException; 
import com.viettel.core.exceptions.DataAccessException; 
import com.viettel.core.dao.cms.QuestionsDAO;
import com.viettel.core.entities.cms.Questions;
import com.viettel.core.entities.vo.QuestionSearchFilter;
import com.viettel.core.entities.vo.QuestionSearchVO;
import com.viettel.core.entities.vo.QuestionUserVO;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
 public class QuestionsMgrImpl implements QuestionsMgr{ 
	@Autowired 
	QuestionsDAO questionsDAO; 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public Questions getQuestionsById(Integer id) throws BusinessException { 
		try { 
			return  questionsDAO.getQuestionsById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public Questions createQuestions(Questions questions) throws BusinessException { 
		try { 
			return questionsDAO.createQuestions(questions); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateQuestions(Questions questions) throws BusinessException { 
		try { 
			questionsDAO.updateQuestions(questions); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteQuestions(Questions questions) throws BusinessException { 
		try { 
			questionsDAO.deleteQuestions(questions); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<QuestionSearchVO> getListQuestionByFilter(
			QuestionSearchFilter filter) throws BusinessException {
		try { 
			return questionsDAO.getListQuestionByFilter(filter);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<QuestionUserVO> getListQuestionByPhone(String phone, Integer maxRows)
			throws BusinessException {
		try { 
			return questionsDAO.getListQuestionByPhone(phone,maxRows);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
	@Override
	public List<Questions> getListQuestionArticleId(Integer id) throws BusinessException{
		try { 
			return questionsDAO.getListQuestionArticleId(id);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override
	public List<Questions> getListQuestionsByCmsUserId(Integer id) throws BusinessException{
		try { 
			return questionsDAO.getListQuestionsByCmsUserId(id);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override
	public List<Questions> getListQuestionsByUserId(Integer id) throws BusinessException{
		try { 
			return questionsDAO.getListQuestionsByUserId(id);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override
	public List<Questions> getListQuestionsNearOverTime() throws BusinessException{
		try { 
			return questionsDAO.getListQuestionsNearOverTime();
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	
} 
